﻿#ifndef PINYINHAND_H
#define PINYINHAND_H

#include <QObject>
#include <QWidget>
#include <QImage>

class PinYinHand : public QWidget
{
    Q_OBJECT
public:
    explicit PinYinHand(QWidget *parent = 0);

protected:
    void mousePressEvent(QMouseEvent *);
    void mouseMoveEvent(QMouseEvent *);
    void mouseReleaseEvent(QMouseEvent *);
    void paintEvent(QPaintEvent *);

private:
    bool mousePressed;  //鼠标是否按下
    int penWidth;       //画笔宽度
    QColor penColor;    //画笔颜色
    QColor bgColor;     //背景颜色
    QImage image;       //绘制图片

public:
    void clear();       //清空图片
};

#endif // PINYINHAND_H
